/**
 * router.js
 */

const Router = require("koa-router")
const router = new Router()
const apiController = require('../controller/api');
const Auth = require('../middleware/auth')

router.prefix('/api')
router.post('/tag',Auth, apiController.createdTag)

router.get('/user/tags', apiController.getTags)

router.get('/tag', apiController.getTag)

router.post('/article',Auth, apiController.createArticle)
router.get('/user/articles', apiController.getArticles)

router.get('/article', apiController.getArticle)

router.post('/login', apiController.login)
router.post('/tag',Auth, apiController.createTag)
router.post('/tag/delete',Auth, apiController.deleteTag)
router.post('/article/change',Auth, apiController.changeArticle)
module.exports = router